home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / skipandgouls.swf / scripts / __Packages / objHSNick.as < prev    next >
Text File  |  2007-10-01  |  4KB  |  146 lines

  1. class objHSNick
  2. {
  3.    function objHSNick()
  4.    {
  5.       this.bHSAvailable = true;
  6.       this.G_TestHighScore = false;
  7.       this.bSubmitHS = false;
  8.       this.bGetHS = false;
  9.       this.G_GameID = "sb_ghouls";
  10.       this.mcHSZone = undefined;
  11.       if(this.G_TestHighScore == true)
  12.       {
  13.          _global.gProxyObj.setServer("www.nick.com");
  14.          _global.gProxyObj.setScreenName("dd_programmer");
  15.          _global.gProxyObj.setIsLoggedIn(true);
  16.       }
  17.    }
  18.    function getScores()
  19.    {
  20.       trace("getScore " + _global.gProxyObj);
  21.       if(_global.gProxyObj == undefined)
  22.       {
  23.          this.listScores();
  24.       }
  25.       else
  26.       {
  27.          _global.gProxyObj.getScores(this.cbFunc2);
  28.       }
  29.    }
  30.    function submitScore(theScore)
  31.    {
  32.       this.addMessage("The high score list is updating!");
  33.       _global.gProxyObj.submitScore(theScore,this.cbFunc);
  34.    }
  35.    function initHiScores()
  36.    {
  37.       _global.gProxyObj.setGame_Id(this.G_GameID);
  38.    }
  39.    function getScoreString()
  40.    {
  41.       var _loc8_ = "Oops! The high score list is not available right now!";
  42.       if(_global.gProxyObj != undefined)
  43.       {
  44.          var _loc7_ = _global.gProxyObj.getScoreCount();
  45.          trace(_loc7_);
  46.          if(_loc7_ > 0)
  47.          {
  48.             var _loc3_ = undefined;
  49.             var _loc4_ = undefined;
  50.             var _loc5_ = undefined;
  51.             var _loc6_ = undefined;
  52.             this.removeMessage();
  53.             _loc3_ = 0;
  54.             while(_loc3_ < _loc7_)
  55.             {
  56.                _loc8_ = "";
  57.                _loc4_ = _global.gProxyObj.getScoreItem(_loc3_);
  58.                _loc5_ = _loc4_[0];
  59.                trace(_loc5_);
  60.                _loc6_ = _loc4_[1];
  61.                _global.C.oPackaging.oHiScore.addEntry(_loc5_,_loc6_);
  62.                _loc3_ = _loc3_ + 1;
  63.             }
  64.          }
  65.          else
  66.          {
  67.             this.addMessage("Oops! The high score list is not available right now!");
  68.          }
  69.       }
  70.       else
  71.       {
  72.          this.addMessage("Oops! The high score list is not available right now!");
  73.       }
  74.       return _loc8_;
  75.    }
  76.    function listScores()
  77.    {
  78.       this.getScoreString();
  79.    }
  80.    function cbFunc(thisBool)
  81.    {
  82.       trace("cbFunc" + thisBool);
  83.       if(thisBool)
  84.       {
  85.          _global.oHS.listScores();
  86.       }
  87.       else
  88.       {
  89.          this.addMessage("Oops! The high score list is not available right now!");
  90.       }
  91.    }
  92.    function cbFunc2(thisBool)
  93.    {
  94.       trace("*" + thisBool);
  95.       if(thisBool)
  96.       {
  97.          _global.oHS.listScores();
  98.       }
  99.       else
  100.       {
  101.          this.addMessage("Oops! The high score list is not available right now!");
  102.       }
  103.    }
  104.    function fDoHSInit()
  105.    {
  106.       this.initHiScores();
  107.       if(_global.gProxyObj.getIsLoggedIn())
  108.       {
  109.          this.mcHSZone.btnSubmitHS._visible = true;
  110.       }
  111.       else
  112.       {
  113.          this.mcHSZone.btnSubmitHS._visible = false;
  114.       }
  115.    }
  116.    function fDoSubmitHS(l_mcStage)
  117.    {
  118.       this.bSubmitHS = true;
  119.    }
  120.    function fDoViewHS(l_mcStage, l_bFromGame)
  121.    {
  122.       this.bGetHS = true;
  123.       _global.KMC.startHighScore(l_mcStage,l_bFromGame);
  124.    }
  125.    function fSetHSBoard(P_mcRef)
  126.    {
  127.       this.mcHSZone = P_mcRef;
  128.       if(_global.gProxyObj.getIsLoggedIn())
  129.       {
  130.          this.mcHSZone.btnSubmitHS._visible = true;
  131.       }
  132.       else
  133.       {
  134.          this.mcHSZone.btnSubmitHS._visible = false;
  135.       }
  136.    }
  137.    function addMessage(l_sMsg)
  138.    {
  139.       _global.C.oPackaging.oHiScore.setMessage(l_sMsg);
  140.    }
  141.    function removeMessage()
  142.    {
  143.       _global.C.oPackaging.oHiScore.clearMessage();
  144.    }
  145. }
  146.